﻿
        function preview() {
            bdhtml = window.document.body.innerHTML;
            sprnstr = "<!--startprint-->";
            eprnstr = "<!--endprint-->";
            prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
            prnhtmlprnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));

//            alert(prnhtmlprnhtml);

            window.document.body.innerHTML = prnhtmlprnhtml;
            window.print();
            history.go(-1);
        }   